home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: help with strcmp
- Date: 3 Apr 1996 13:50:09 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4jurqhINNao@anvil.ugrad.cs.ubc.ca>
- References: <4jpiek$lp6@blaze.cs.jhu.edu> <DpAI6o.2Cq@iquest.net> <4jup7d$8s5@solutions.solon.com>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <4jup7d$8s5@solutions.solon.com>,
- Peter Seebach <seebs@solutions.solon.com> wrote:
- >Once again: feof() informs you only that the last read failed; it doesn't
- >belong before a read.
-
- Whoa, are you implying that the feof() status is _undefined_ before you do the
- first read or merely that it's an indication of bad style to have the check
- before a read? I recently posted some code which does check ferror() and feof()
- before doing a read, although not in the same sense that Pascal newbies make
- the mistake. It's the code in which lines from two files are read
- concurrently (in the lame sense of the word, of course!), and as long as one of
- them has no ferror() or feof() condition, the loop has to continue. The outer
- loop does a bottom test, but inside the loop, the entry into two scanning
- inner-loops is guarded by checking ferror() and feof(), which the first time
- around happens before anything is read.
- --
-
-